<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<div class="header">
	<h2>
		&nbsp;&nbsp;系统个性化定制<span><font color="red">（* 为必填项）</font> </span>
	</h2>
</div>
<form action="app/appConfig/save" id="formAppConfig" method="post">
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">企业名称：</td>
				<td class="td2"><input type="text" id="txtCompanyName"
					name="companyName" value="${companyName}" maxlength="50"
					style="width:30%" class="required" />
				</td>
			</tr>

			<tr>
				<td class="td1">软件标题：</td>
				<td class="td2"><input type="text" id="txtCompanyIntro"
					name="companyIntro" value="${companyIntro}" maxlength="50"
					style="width:30%" class="required" /> （左侧距离：<input type="text"
					id="companyIntroLeft" name="companyIntroLeft"
					value="${companyIntroLeft}" maxlength="50" class="required number" />）</td>
			</tr>
			<tr>
				<td class="td1">客户门户标题：</td>
				<td class="td2"><input type="text"
					id="txtCompanyIntroForCustomerHelp"
					name="companyIntroForCustomerHelp"
					value="${companyIntroForCustomerHelp}" maxlength="50"
					style="width:30%" class="required" />
				</td>
			</tr>
			<tr>
				<td class="td1">400热线：</td>
				<td class="td2"><input type="text" id="txtCompanyReportTel"
					name="companyReportTel" value="${companyReportTel}" maxlength="50"
					style="width:30%"  />
				</td>
			</tr>
			<tr>
				<td class="td1">公司网站：</td>
				<td class="td2"><input type="text" id="txtCompanyWebsite"
					name="companyWebsite" value="${companyWebsite}" maxlength="200"
					style="width:60%"  />（如：http://www.abc.com）</td>
			</tr>
			<tr>
				<td class="td1">企业Logo：</td>
				<td class="td2" align="left">
				<div style="width:12%">
				<isperp:photoUploader imgName="companyLogo"
						cutType="0" imgWidth="140" imgHeight="35" imgSrc="${companyLogo}"
						id="companyLogo" imgPath="logo" imgFormat="png/gif/jpg"></isperp:photoUploader>
						</div>
				</td>
			</tr>
			

			<tr>
				<td class="td1">登陆界面：</td>
				<td class="td2"><isperp:uploader sourceId="bgImg" id="companyLogin" ></isperp:uploader><span><font
						color="blue">（格式：png/gif/jpg）</font> </span></td>
			</tr>
			<tr>
				<td class="td1">是否启用锁定屏幕：</td>
				<td class="td2"><input type="radio" id="systemLockscreen1"
					name="systemLockscreen" value="1" /><label for="systemLockscreen1">是</label>
					(超时<input type="text" id="systemLockscreenTimeout"
					name="systemLockscreenTimeout" value="${systemLockscreenTimeout}"
					maxlength="50" style="width:30px" />分钟锁定屏幕)&nbsp;<input
					type="radio" id="systemLockscreen2" name="systemLockscreen"
					value="0" /><label for="systemLockscreen2">否</label>
			</tr>



			<tr style="display:none">
				<td class="td1">运行模式：</td>
				<td class="td2"><input type="radio" id="systemRunMode1"
					name="systemRunMode" value="1" /><label for="systemRunMode1">正式发布模式(访问速度更快)</label>
					<input type="radio" id="systemRunMode2" name="systemRunMode"
					value="0" /><label for="systemRunMode2">调试模式</label>
				</td>

			</tr>
			<tr style="display:none">
				<td class="td1">查询缓存超时：</td>
				<td class="td2"><input type="text" id="txtQueryCacheOuttime"
					name="queryCacheOuttime" value="${queryCacheOuttime}"
					maxlength="20" class="number required" />毫秒</td>

			</tr>
		</tbody>
	</table>
	<div class="header">
		<h2>&nbsp;&nbsp;邮件发送/接收接口设置</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">邮件服务器：</td>
				<td class="td2"><input type="text" id="txtMailServer"
					name="mailServer" value="${mailServer}" maxlength="50"
					style="width:30%" /><span><font color="blue">（例如：mail.163.com）</font>
				</span>
				</td>
			</tr>
			<tr>

				<td class="td1">邮箱地址：</td>
				<td class="td2"><input type="text" id="txtMailAddress"
					name="mailAddress" value="${mailAddress}" maxlength="50"
					style="width:30%" /><span><font color="blue">（例如：zhangshan@163.com）</font>
				</span>
				</td>
			</tr>
			<tr>

				<td class="td1">发送端口：</td>
				<td class="td2"><input type="text" id="txtMailPort"
					name="txtMailPort" value="${txtMailPort}" maxlength="50"
					style="width:30%" /><span><font color="blue">（默认：25）</font>
				</span>
				</td>
			</tr>
			<tr>

				<td class="td1">帐号：</td>
				<td class="td2"><input type="text" id="txtMailAccount"
					name="mailAccount" value="${mailAccount}" maxlength="50"
					style="width:30%" /><span><font color="blue">（例如：zhangshan）</font>
				</span>
				</td>
			</tr>
			<tr>

				<td class="td1">密码：</td>
				<td class="td2"><input type="password" id="txtMailPassword"
					name="mailPassword" value="${mailPassword}" maxlength="50"
					style="width:30%" />
				</td>
			</tr>

		</tbody>
	</table>
	<%-- <div class="header">
		<h2>&nbsp;&nbsp;短信发送接口设置</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">短信服务器(IP)：</td>
				<td class="td2"><input type="text" id="txtSMSServer"
					name="smsServer" value="${smsServer}" maxlength="50"
					style="width:30%" /></td>
			</tr>
			<tr>

				<td class="td1">用户名：</td>
				<td class="td2"><input type="text" id="txtSmsUser"
					name="smsUser" value="${smsUser}" maxlength="50" style="width:30%" />
				</td>
			</tr>
			<tr>
				<td class="td1">密码：</td>
				<td class="td2"><input type="password" id="txtSmsPassword"
					name="smsPassword" value="${smsPassword}" maxlength="50"
					style="width:30%" /></td>
			</tr>
			<tr>

				<td class="td1">数据库名称：</td>
				<td class="td2"><input type="text" id="txtSmsDbName"
					name="smsDbName" value="${smsDbName}" maxlength="50"
					style="width:30%" /></td>
			</tr>
			<tr>

				<td class="td1">API编码：</td>
				<td class="td2"><input type="text" id="txtSmsApiId"
					name="smsApiId" value="${smsApiId}" maxlength="50"
					style="width:30%" /></td>
			</tr>

		</tbody>
	</table> --%>

	<%-- <div class="header">
		<h2>&nbsp;&nbsp;百度定位及推送设置</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">ak：</td>
				<td class="td2"><input type="text" id="txtBaiduApk"
					name="baiduApk" value="${baiduApk}" maxlength="50"
					style="width:30%" /></td>
			</tr>
			<tr>
				<td class="td1">百度推送api_key：</td>
				<td class="td2"><input type="text" id="baiduPushApiKey"
					name="baiduPushApiKey" value="${baiduPushApiKey}" maxlength="100"
					style="width:30%" />
				</td>
			</tr>
			<tr>
				<td class="td1">百度推送api_secret_key：</td>
				<td class="td2"><input type="text" id="baiduPushSecretKey"
					name="baiduPushSecretKey" value="${baiduPushSecretKey}"
					maxlength="100" style="width:30%" />
				</td>
			</tr>
		</tbody>
	</table> --%>

	<div class="header">
		<h2>&nbsp;&nbsp;文件上传设置</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">文件格式：</td>
				<td class="td2"><input type="text" id="txtFileFormat"
					name="fileFormat" value="${fileFormat}" maxlength="100"
					style="width:30%" /><span><font color="blue">（设置允许上传的附件格式，默认支持jpg,gif,png,jpeg,txt,doc,docx,xls,xlsx,ppt,pptx,pdf,zip,rar）</font>
				</span></td>
			</tr>
			<tr>

				<td class="td1">文件大小：</td>
				<td class="td2"><input type="text" id="txtFileSize"
					name="fileSize" value="${fileSize}" maxlength="50"
					style="width:30%" /><span><font color="blue">
							M(设置上传文件大小的上限,默认10M)</font> </span></td>
			</tr>

		</tbody>
	</table>


	<%-- <input type="hidden" id="apkFilePath" name="apkFilePath"
		value="${apkFilePath }">

	<div class="header">
		<h2>&nbsp;&nbsp;系统域名绑定</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">绑定域名：</td>
				<td class="td2"><input type="text" id="webServerName"
					name="webServerName" value="${webServerName}" maxlength="50"
					style="width:30%" />（如：http://www.xxx.com/demo/）</td>
			</tr>


			<tr>
				<td class="td1">APP配置服务器地址：</td>
				<td class="td2"><input type="text" id="appConfigAddress"
					name="appConfigAddress" value="${appConfigAddress}" maxlength="50"
					style="width:30%" />
			</tr>
			 --%>


			</form>
			<table class=" form-table">
				<tbody>
					<tr>
						<td class="td1"></td>
						<td class="td2"><button type="submit" id="btnSaveAppConfig"
								class="nui-mainbtn" onclick="btnSaveAppConfigOnclick();return false;"
								name="btnSaveAppConfig" value="保存">&nbsp;&nbsp;&nbsp;保存&nbsp;&nbsp;&nbsp;</button>
						</td>
					</tr>

				</tbody>
			</table>

			<script type="text/javascript">
				$("input[name=systemRunMode][value=${systemRunMode}]").attr("checked", 'checked');
				$("input[name=systemLockscreen][value=${systemLockscreen}]").attr("checked", 'checked');

				function btnSaveAppConfigOnclick() {

					isperp.showLoading();
					isperp.submitForm({
						formId : "formAppConfig",
						success : function(data) {
							isperp.hideLoading();
							if (data.success) {
								isperp.alert("保存成功！");
							} else {
								isperp.alert(data.tata);
							}
						},
						error : function() {

							isperp.hideLoading();
							isperp.alert("保存失败！");
						}
					});
				}

				function uploadApk() {
					isperp.submitForm({
						"formId" : "uploadApkForm",
						success : function(data) {

							isperp.alert("文件上传成功，路径为：" + data.path);
							$("#apkFilePath").val(data.path);
						}
					});
				}

				function resetAccessToken() {
					$.post("app/appConfig/resetAccessToken", function(data) {
						$("#lbAccessToken").text(data.data);
						isperp.alert("重置成功");

					});
				}
			</script>